import User

public class Account {

  Long id
  String username
  String password
  String email
  User user
  Role role

  static hasOne = [user: User, role: Role]
  static fetchMode = [user: 'eager']
  
  static def constraints = {
    id(blank: false, unique: true)
    username(size: 3..25, blank: false, unique: true)
    password(size: 1..50, blank: false)
    email(email: true, blank: false)
  }

}
